package com.md.facade;

import com.md.api.GlobalConfigApi;
import com.md.application.service.GlobalConfigApplication;
import com.md.config.Logs;
import com.md.model.system.CommonResult;
import com.md.request.GlobalConfigRequest;
import com.md.response.GlobalConfigResponse;
import com.md.value.enums.OperationEnum;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author 刘骄阳
 * 2024-12-15 1:41
 */
@RestController
@RequiredArgsConstructor
public class GlobalConfigController implements GlobalConfigApi {
  private final GlobalConfigApplication globalConfigApplication;

  @Override
  @Logs(title = "查询配置列表", operation = OperationEnum.SELECT)
  public CommonResult<List<GlobalConfigResponse>> list() {
    return globalConfigApplication.list();
  }

  @Override
  @Logs(title = "更新配置", operation = OperationEnum.UPDATE)
  public CommonResult<GlobalConfigResponse> update(final GlobalConfigRequest request) {
    return globalConfigApplication.update(request);
  }
}
